package com.xiaomuwu.android.ui

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import androidx.lifecycle.ViewModel
import com.xiaomuwu.android.logic.Repository

class MainViewModel: ViewModel() {

    private val toPersonalLiveData=MutableLiveData<String?>()

    var personalLiveData=Transformations.switchMap(toPersonalLiveData){toGet->
        Repository.getPersonal(toGet)
    }

    fun getPersonalLiveData(toGet: String?){
        toPersonalLiveData.value=toGet
    }

}